<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMerchantTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('merchant', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('enterprise_id')                ->default(0)    ->comment('企业id');
            $table->integer('logo_img_id')                  ->default(0)    ->comment('店铺logo图id');
            $table->string('name')                          ->default('')   ->comment('店铺名');
            $table->string('desc')                          ->default('')   ->comment('店铺简介');
            $table->string('business_license')              ->default('')   ->comment('营业执照');
            $table->integer('business_license_img_id')      ->default(0)    ->comment('营业执照的图片');
            $table->string('province')                      ->default('')   ->comment('所在省');
            $table->string('city')                          ->default('')   ->comment('所在市');
            $table->string('area')                          ->default('')   ->comment('所在区');
            $table->string('address')                       ->default('')   ->comment('详细地址');
            $table->string('lng')                           ->default('')   ->comment('经度');
            $table->string('lat')                           ->default('')   ->comment('纬度');
            $table->string('business_time')                 ->default('')   ->comment('营业时间');
            $table->timestamp('business_start_time')        ->nullable()          ->comment('营业开始时间');
            $table->timestamp('business_end_time')          ->nullable()          ->comment('营业结束时间');
            $table->string('support_delivery_method')       ->default('')   ->comment('店铺支持的交货方式：存储json_encode后的数组');
            $table->mediumText('detail')                    ->nullable()          ->comment('详情');
            $table->string('contact')                       ->default('')   ->comment('联系方式');
            $table->string('type')                          ->default('')   ->comment('类型：待定');
            $table->integer('sort')                         ->default(0)    ->comment('排序，数值越小越靠前');
            $table->integer('status')                       ->default(0)    ->comment('营业状态：0未营业,1营业中，2店铺已关闭');
            $table->integer('review')                       ->default(0)    ->comment('审核状态：0未审核，1已通过，2已拒绝');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
//        Schema::dropIfExists('merchant');
    }
}
